package com.hh.demo.web.controller;

import com.hh.demo.result.JSONResult;
import com.hh.demo.service.ITokenService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 黄浩
 * @create 2022-07-28 22:40
 */
@RestController
public class TokenController {
    @Resource
    private ITokenService tokenService;

    @GetMapping("createToken/{courseId}")
    public JSONResult createToken(@PathVariable("courseId")String courseId){
        String token = tokenService.createToken(courseId);
        return JSONResult.success(token);
    }
}
